home *** CD-ROM | disk | FTP | other *** search
- cleanUp = function(str)
- {
- return stringReplace(str,"$",",");
- };
- creditsVars = new LoadVars();
- creditsVars.onData = function(data)
- {
- trace("onData()");
- var arrLines = data.split("\r\n");
- trace(" - " + arrLines.length + " lines parsed");
- var arrArtists = new Array();
- var _loc2_ = new Array();
- var title;
- var writer;
- var publisher;
- var currArtistName = 0;
- var _loc1_ = 0;
- var _loc3_ = 1;
- while(_loc3_ < arrLines.length)
- {
- var strLine = arrLines[_loc3_];
- _loc2_ = strLine.split(",");
- artistName = _loc2_[0];
- if(artistName != "")
- {
- trace(_loc3_ + ". " + artistName);
- if(artistName != _loc1_.name)
- {
- var _loc0_ = null;
- _loc1_ = arrArtists[arrArtists.length] = new Object();
- _loc1_.name = cleanUp(artistName);
- _loc1_.pLine = cleanUp(_loc2_[4]);
- _loc1_.tracks = new Array();
- }
- _loc1_.tracks.push({t:cleanUp(_loc2_[1]),w:cleanUp(_loc2_[2]),p:cleanUp(_loc2_[3])});
- }
- else
- {
- _loc1_ = 0;
- }
- _loc3_ = _loc3_ + 1;
- }
- trace(" - " + arrArtists.length + " artists parsed");
- buildPage(arrArtists);
- };
- if(_parent == _root)
- {
- creditsVars.load("music_credits.csv");
- }
- else
- {
- creditsVars.load(Tardis.ASSETS_FOLDER + "panels/music_credits.csv");
- }
- stop();
- stringReplace = function(str, searchWord, replaceWith)
- {
- var _loc2_ = searchWord;
- var _loc1_ = str;
- var myString2;
- var _loc3_ = undefined;
- var replace;
- if(_loc1_ == "" || _loc2_ == replaceWith)
- {
- }
- if(_loc1_.indexOf(_loc2_) != -1)
- {
- while(_loc1_.indexOf(_loc2_) != -1)
- {
- _loc3_ = _loc1_.indexOf(_loc2_);
- myString2 = _loc1_.slice(_loc3_ + _loc2_.length,_loc1_.length);
- _loc1_ = _loc1_.slice(0,_loc3_) + replaceWith + myString2;
- }
- }
- return _loc1_;
- };
-